package com.zmj.common.data;

import com.zmj.common.model.User;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangmj
 * @date 2019/4/3 13:02
 */
public class CacheData {

    private static final Map<Integer, User> userMap = new HashMap<Integer, User>();

    static {
        User user1 = new User("苏大强",1001,"苏州市寒山寺1号院",60,"男");
        User user2 = new User("苏明哲",1002,"苏州市姑苏区小林花园1号楼",40,"男");
        User user3 = new User("苏明成",1003,"苏州市吴中区温馨家园小区",35,"男");
        User user4 = new User("苏明玉",1004,"上海市闵行区多宝大厦1号楼",30,"女");
        userMap.put(user1.getCode(),user1);
        userMap.put(user2.getCode(),user2);
        userMap.put(user3.getCode(),user3);
        userMap.put(user4.getCode(),user4);
    }

    public static User getUserInfo(Integer code){
        if(code != null){
            return userMap.get(code);
        }
        return null;
    }
}
